#ifndef BROLIST_H
#define BROLIST_H

#include <QWidget>
#include <QListWidgetItem>
#include <QTcpSocket>
#include <QVector>
#include <QTimer>
#include "data.h"

namespace Ui {
class BroList;
}

class BroList : public QWidget
{
    Q_OBJECT

public:
    explicit BroList(QTcpSocket *m_tcp, QString id_, QWidget *parent = 0);
    ~BroList();
    QListWidget *w;
    QTcpSocket *m_t;
    QString uid;
    QVector<QString> uids;
    QVector<QString> names;
    Data *sql;
    void recvPcnt(int cnt);
    void recvId(QString uid);
    void recvListOver();
    void recvMsg(QString msg);
    void recvFileText(QString data_);
    void recvGroupMsg(QString from, QString msg);

private slots:
    void on_update_clicked();

signals:
    void sendId_Msg(QString from_id, QString to_id, QString msg);
    void sendMsg(QString msg);
    void sendFileContent(QString from, QString to, int len, QString data);
    void sendFileText(QString data_);
    void sendGroupMsg(QString from, QString msg);
    void sendTp(QString tp);
    void sendNoSay(QString noSay);
    void sendOpenSay(QString openSay);

private:
    Ui::BroList *ui;

};

#endif // BROLIST_H
